import { Breadcrumb } from 'antd'
import { useLocation, matchRoutes } from 'react-router-dom'
import { routes } from '@/router'
import styles from '../index.module.scss'

const HomeBreadcrumb = () => {
  const location = useLocation()
  const matchs = matchRoutes(routes, location)

  return (
    <Breadcrumb
      className={styles['home-breadcrumb']}
      items={matchs?.map((v) => {
        return {
          title: v.route.meta?.title,
        }
      })}
    />
  )
}
export default HomeBreadcrumb
